home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / b2obj11b.zip / TUTORIAL < prev   
Text File  |  1994-06-11  |  3KB  |  77 lines

  1. ACA BIN2OBJ 1.10b Tutorial
  2.  
  3.  
  4. The command line parameters for ACA BIN2OBJ is
  5.  
  6.     BIN2OBJ Name.obj _NAME_DATA_ DATA WORD _Name_ Name.dat
  7.     ^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^ ^^^^ ^^^^ ^^^^^^ ^^^^^^^^
  8.        0        1         2        3    4     5      6
  9.     0:  executable name
  10.     1:  object file name
  11.     2:  data segment name
  12.     3:  class type         "DATA" or "FAR_DATA"
  13.     4:  segment alignment  "BYTE", "WORD", "PARA", or "PAGE"
  14.     5:  public name
  15.     6:  binary data file
  16.  
  17. None of these parameters could be omit.
  18.  
  19.  
  20. 0.    Executable name.  Of course, you need BIN2OBJ.EXE to run.
  21.  
  22. 1.    Object file name.  Choose a reasonable name for your object
  23.     file.  Besure add .OBJ extension because BIN2OBJ won't add
  24.     it for you.
  25.  
  26. 2.    Data segment name.  This is the name for the data segment.
  27.     It could be anything, but the best choice is to be the same
  28.     name as the _DATA or _FARDATA if the data segment does not
  29.     exceed 64K so that these data segment can be packed together
  30.     by linker.  If there are going to be many files inserted into
  31.     an executable, it is also a good choice to creat a unique
  32.     segment name for them.
  33.  
  34. 3.    Class type.  It usually should be "DATA" or "FAR_DATA".  If
  35.     you want put it at END of the executable, choose other names.
  36.     Be sure to check the linker map file.
  37.  
  38. 4.    Segment alignment.  This part tells linker how to align your
  39.     data segment.  either at byte (any where), word   (even place),
  40.     para (paragraph or 16 byte), or page (256 bytes) boundary.  If
  41.     you choose the data segment name as _DATA or _FARDATA that are
  42.     compiler default, this part should be PARA.  If the data segment
  43.     is to be associated with a segment register with index offset
  44.     0, then the data segment should also be PARA.  Otherwise, BYTE
  45.     or WORD doesn't seem to matter much.
  46.  
  47. 5.    Public name.  This is the name of the identifier.  If the
  48.     identifier is used in C, there should be a underscore '_'
  49.     character at the beginning.  The actually data type can
  50.     be defined as any type of pointer.  The data type is not
  51.     defined here.
  52.  
  53. 6.    Binary data file.  ACA BIN2OBJ treats any data file as binary.
  54.     So if you just want print a long ascii text file on screen, it
  55.     should be fine.  But it is better to remove all CR's (carriage
  56.     returns) in the text file.  See the test file comment to get
  57.     more informations.
  58.  
  59.  
  60. Example:
  61.  
  62.     bin2obj introdoc.obj _RES_DATA DATA BYTE _IntroText test.txt
  63.     bin2obj intropic.obj _RES_DATA DATA BYTE _IntroPict test.vga
  64.  
  65.     Linker will automatically pack these object files into one
  66.     segment.
  67.     
  68.     Note the underscores '_' at the beginning of two names at
  69.     command line.  They are required in C.
  70.  
  71.     The data type of _IntroText and _IntroPict in C are
  72.         extern unsigned char IntroText[1];
  73.         extern unsigned char IntroPict[1];
  74.     extern unsigned char[1] data type will tell the C compiler
  75.     that IntroText and IntroPict are arrays of unsigned chars.
  76.     They can be treated as pointers.
  77.